import request from '@/utils/request'

// 查询教师表列表
export function getAllWokings() {
  return request({
    url: '/teacher/teachers/working',
    method: 'get'
  })
}

//查询考勤组的班次和人员
export function Classes(groupId){
  return request({
    url: '/teacher/teachers/classes/'+ groupId,
    method: 'get'
  })
}

//查询考勤组的班次和人员
export function Teachers(groupId){
  return request({
    url: '/teacher/teachers/teachers/'+ groupId,
    method: 'get'
  })
}
// 查询所有考勤组
export function getattendances() {
  return request({
    url: '/teacher/teachers/attendances',
    method: 'get'
  })
}

// 查询教师表列表
export function listTeachers(query) {
  return request({
    url: '/teacher/teachers/list',
    method: 'get',
    params: query
  })
}

// 查询教师表详细
export function getTeachers(teacherId) {
  return request({
    url: '/teacher/teachers/' + teacherId,
    method: 'get'
  })
}

// 新增教师表
export function addTeachers(data) {
  return request({
    url: '/teacher/teachers',
    method: 'post',
    data: data
  })
}

// 新增排班
export function addWorking(data) {
  return request({
    url: '/teacher/teachers/addworking',
    method: 'post',
    data: data
  })
}

// 修改教师表
export function updateTeachers(data) {
  return request({
    url: '/teacher/teachers',
    method: 'put',
    data: data
  })
}

// 删除教师表
export function delTeachers(teacherId) {
  return request({
    url: '/teacher/teachers/' + teacherId,
    method: 'delete'
  })
}
